<template>
	<view class="container">
		<customNavigation></customNavigation>
		<scroll-view scroll-y="true" class="main">
			<homeSwiper :swiperListData="swiperListData"></homeSwiper>
			<u-notice-bar :text="noticeContent"></u-notice-bar>
			<!-- <view class="view1"></view>
			<view class="view2"></view>
			<view class="view3"></view> -->
		</scroll-view>
	</view>
</template>
<script>
	export default{
		data(){
			return{
				swiperListData:[],
				noticeContent:'蜗牛商城今日有折扣，2折商品，请进入!'
			}
		},
		methods:{
			
			async getSwiper(){
				
				const result=await uni.$api.homeModules.getSwiperApi()
				this.swiperListData=result.data.data
				
				/**
				uni.request({
					url:'http://vueshop.glbuys.com/api/home/index/slide?token=1ec949a15fb709370f',
					success:(res)=>{
						console.log('data',res.data.data);
						this.swiperListData=res.data.data
					},
					fail: (err) => {
						console.log('err',err);
					},
					complete: () => {
						console.log('complete');
					}
				})
				**/
				
			}
			
		},
		onLoad() {
			this.getSwiper()
		}
	}
</script>
<style lang="scss">
	.main{
		/* #ifdef H5 */
	    height: 100vh;
		/* #endif */
		/* #ifdef APP||APP-PLUS */
		height: calc(100vh - 20px);
		/* #endif */
		/* #ifdef MP-WEIXIN */
		height: calc(100vh - 60px);
		/* #endif */
		.view1{
			width: 750rpx;
			height: 700rpx;
			background-color: tomato;
		}
		.view2{
			width: 750rpx;
			height: 700rpx;
			background-color: springgreen;
		}
		.view3{
			width: 750rpx;
			height: 700rpx;
			background-color: deepskyblue;
		}
	}
</style>